﻿using System;
using System.Collections.Generic;
using System.Data.Objects;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using DAL.Data;

namespace DAL.Classes.Repository
{
    public abstract class Repository : IRepository
    {
        protected ModelContainer DataBase { get; set; }
        private IDataBaseFactory dataBaseFactory;

        protected Repository()
        {
            dataBaseFactory = new DataBaseFactory();
            DataBase = dataBaseFactory.Create();
        }

        public void Save()
        {
            DataBase.SaveChanges(SaveOptions.DetectChangesBeforeSave);
        }
    }
}
